package com.jinke.api.modules.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jinke.api.modules.app.model.OrderParcel;
import com.jinke.api.modules.app.mapper.OrderParcelsMapper;
import com.jinke.api.modules.app.service.OrderParcelService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 承运商平台 服务实现类
 * </p>
 *
 * @author macro
 * @since 2024-01-15
 */
@Service
public class OrderParcelsServiceImpl extends ServiceImpl<OrderParcelsMapper, OrderParcel> implements OrderParcelService {


    /**
     * 通过订单id批量获取对应的物流单号
     * @param orderIdList
     * @return
     */
    @Override
    public List<OrderParcel> getParcelByOrderIdList(List<Integer> orderIdList) {
        List<OrderParcel> orderParcels = list(new LambdaQueryWrapper<OrderParcel>()
                .in(OrderParcel::getOrderId, orderIdList)
                .select(OrderParcel::getTrackingNumber,OrderParcel::getId)

        );

        return orderParcels;
    }
}
